package com.appwoo.txtws.activity;

import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.GestureDetector;
import android.view.GestureDetector.OnGestureListener;
import android.view.MotionEvent;
import android.widget.RadioGroup;
import android.widget.RadioGroup.OnCheckedChangeListener;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;
import java.io.PrintStream;

public class MainTabActivity extends BaseTabActivity
  implements GestureDetector.OnGestureListener, RadioGroup.OnCheckedChangeListener
{
  private static final String TAB_TAG_HOME = "tab_tag_home";
  private static final String TAB_TAG_LOVE = "tab_tag_loveHeart";
  private static final String TAB_TAG_OTHER = "tab_tag_other";
  private static final String TAB_TAG_RECODE = "tab_tag_recode";
  private static final String TAB_TAG_TIME = "tab_tag_time";
  private int currentTabID = 0;
  private GestureDetector gestureDetector;
  private Intent lovecareIntent;
  private Intent mHomeIntent;
  private Intent mOtherIntent;
  private Intent mRecodeIntent;
  private TabHost mTabHost;
  private Intent mTimeIntent;
  private RadioGroup mainTab;
  int[] tabTag = { 2131493370, 2131493219, 2131493221, 2131493223, 2131493224 };

  private TabHost.TabSpec buildTabSpec(String paramString, int paramInt1, int paramInt2, Intent paramIntent)
  {
    return this.mTabHost.newTabSpec(paramString).setIndicator(getString(paramInt1), getResources().getDrawable(paramInt2)).setContent(paramIntent);
  }

  private void prepareIntent()
  {
    this.mHomeIntent = new Intent(this, HomeActivity.class);
    this.mRecodeIntent = new Intent(this, RecordActivity.class);
    this.mTimeIntent = new Intent(this, TimeFunctionAtivity.class);
    this.mOtherIntent = new Intent(this, OtherAcitvity.class);
  }

  private void setupIntent()
  {
    this.mTabHost = getTabHost();
    TabHost localTabHost = this.mTabHost;
    localTabHost.addTab(buildTabSpec("tab_tag_home", 2131427335, 2130837728, this.mHomeIntent));
    localTabHost.addTab(buildTabSpec("tab_tag_time", 2131427344, 2130837735, this.mTimeIntent));
    localTabHost.addTab(buildTabSpec("tab_tag_recode", 2131427336, 2130837729, this.mRecodeIntent));
    localTabHost.addTab(buildTabSpec("tab_tag_other", 2131427356, 2130837733, this.mOtherIntent));
  }

  public boolean dispatchTouchEvent(MotionEvent paramMotionEvent)
  {
    if (this.gestureDetector.onTouchEvent(paramMotionEvent))
      paramMotionEvent.setAction(3);
    return super.dispatchTouchEvent(paramMotionEvent);
  }

  public void onCheckedChanged(RadioGroup paramRadioGroup, int paramInt)
  {
    switch (paramInt)
    {
    default:
      return;
    case 2131493370:
      this.mTabHost.setCurrentTabByTag("tab_tag_home");
      return;
    case 2131493219:
      this.mTabHost.setCurrentTabByTag("tab_tag_time");
      return;
    case 2131493221:
      this.mTabHost.setCurrentTabByTag("tab_tag_recode");
      return;
    case 2131493223:
      IntentActivity(this, TxtwebActivity.class);
      return;
    case 2131493224:
    }
    this.mTabHost.setCurrentTabByTag("tab_tag_other");
  }

  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    requestWindowFeature(1);
    setContentView(2130903216);
    this.mainTab = ((RadioGroup)findViewById(2131493369));
    this.mainTab.setOnCheckedChangeListener(this);
    prepareIntent();
    setupIntent();
    System.out.println(this.mTabHost.getCurrentTab());
    this.gestureDetector = new GestureDetector(this);
  }

  public boolean onDown(MotionEvent paramMotionEvent)
  {
    return false;
  }

  public boolean onFling(MotionEvent paramMotionEvent1, MotionEvent paramMotionEvent2, float paramFloat1, float paramFloat2)
  {
    float f1 = paramMotionEvent1.getX() - paramMotionEvent2.getX();
    float f2 = paramMotionEvent1.getY() - paramMotionEvent2.getY();
    boolean bool1 = Math.abs(f1) < 2.0D * Math.abs(f2);
    boolean bool2 = false;
    if (bool1)
    {
      if (paramMotionEvent1.getX() - paramMotionEvent2.getX() > -120.0F)
        break label95;
      this.currentTabID = (-1 + this.mTabHost.getCurrentTab());
      if (this.currentTabID < 0)
        this.currentTabID = 4;
    }
    while (true)
    {
      bool2 = true;
      return bool2;
      label95: if (paramMotionEvent1.getX() - paramMotionEvent2.getX() >= 120.0F)
      {
        this.currentTabID = (1 + this.mTabHost.getCurrentTab());
        if (this.currentTabID >= 5)
          this.currentTabID = 0;
      }
    }
  }

  public void onLongPress(MotionEvent paramMotionEvent)
  {
  }

  public boolean onScroll(MotionEvent paramMotionEvent1, MotionEvent paramMotionEvent2, float paramFloat1, float paramFloat2)
  {
    return false;
  }

  public void onShowPress(MotionEvent paramMotionEvent)
  {
  }

  public boolean onSingleTapUp(MotionEvent paramMotionEvent)
  {
    return false;
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.activity.MainTabActivity
 * JD-Core Version:    0.6.2
 */